/*
Copyright (C) Ariff Ehsan, Abdul Hadi Fikri

This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License
as published by the Free Software Foundation; either version 2
of the License, or (at your option) any later version.

This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
GNU General Public License for more details.

You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
*/

/*  Author : Abdul Hadi Fikri
 *  Date   : June 24, 2009
 */


#include <system.h>

/*timer instantiation*/
timer_t app_timer_led;

/*timer event prototype function*/
void APP_TIMER_LED_expired(void);

void APP_booted(){
	/*Configure PORTC as output port*/
	DDRC = 0xFF;
	/*Register timer*/
	TIMER_reg(&app_timer_led,APP_TIMER_LED_expired);
	/*Start periodic timer*/
	TIMER_startPeriodic(&app_timer_led,500);
}

/*timer event function implementation*/
void APP_TIMER_LED_expired(void){
	/*Toggle PORTC each time timer fired*/
	PORTC = ~PORTC;
}